package com.wh.countdownlatch;

import java.util.concurrent.CountDownLatch;

public class NeedToWait implements Runnable {

	private CountDownLatch countDownLatch;
	
	public NeedToWait(CountDownLatch countDownLatch) {
		this.countDownLatch = countDownLatch;
	}
	
	@Override
	public void run() {
		System.out.println("这是需要进行等待的一个线程");
		try {
			countDownLatch.await();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("等待的线程执行完毕");
	}

}
